<?php

declare(strict_types=1);

namespace app\controller\admin;

use app\model\admin\CateModel;
use app\model\admin\Pact;
use app\model\admin\ProfitSet;
use think\facade\Validate;
use think\Request;

class ProfitSetController extends AdminBaseController
{
    public function getInfo(Request $request)
    {
        $info = ProfitSet::find(1);
        return success($info);
    }
    // 设置
    public function setInfo(Request $request)
    {
        $params = $request->param();
        if ($params['id']) {
            ProfitSet::update($params, ['id' => $params['id']]);
        } else {
            ProfitSet::create($params);
        }
        return success();
    }
}
